var readline = require('readline-sync')
readline.setDefaultOptions({ prompt: '' })
var readline = readline.prompt
let n = parseInt(readline()) // 读出这个行数
let chessBoard = []
for (let i = 0; i < n; i++) {
  let row = readline().split(' ').map((item) => parseInt(item))
  chessBoard.push(row)
}
// console.log(chessBoard);
for (let i = 0; i < n; i++) {
  let left = 0
  let right = n - 1
  while (left < right) {
    [chessBoard[left][i], chessBoard[right][i]] = [chessBoard[right][i], chessBoard[left][i]]
    left++
    right--
  }
}
for (let i = 0; i < n; i++) {
  let left = 0
  let right = n - 1
  while (left < right) {
    [chessBoard[i][left], chessBoard[i][right]] = [chessBoard[i][right], chessBoard[i][left]]
    left++
    right--
  }
}
for (let i = 0; i < n; i++) {
  console.log(chessBoard[i].join(' '));
}